package ytl;

import java.applet.Applet;
import java.applet.AudioClip;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.MalformedURLException;
import java.net.URL;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

public class System {

    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    JLabel logo = new JLabel();
    String str = new String();
    JLabel Error_logo = new JLabel();
    JFrame Error_Frame = new JFrame("Error !!");
    
    Container Error_contentPane = Error_Frame.getContentPane();
    Point pt = new Point();
    Box system_menu_box = Box.createVerticalBox();
    
    
    
    // </editor-fold>
    
    public void Init_System(){
        logo.setIcon(new javax.swing.ImageIcon("pictures/YTL Logo.png"));
       
    }

    protected JComponent System_Menu() {
        system_menu_box.removeAll();
        system_menu_box.add(logo);
        system_menu_box.add(Box.createVerticalStrut(10));
      //  system_menu_box.add(Report_button);
        system_menu_box.add(Box.createVerticalStrut(5));

        return system_menu_box;
    }

    public class Action implements ActionListener{
        @Override
        public void actionPerformed(ActionEvent ae){
        }
    }
    
    public static void System() {
           
    }
    
    public static void main(String[] args) {
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                System();
            }
        });
    }
    
    public void Error(){
        pt = Main_Menu.frame.getLocation();
        Error_Frame.setLocation(pt.x + 280,pt.y + 140);
        try{
            Error_thread threads = new Error_thread();
            threads.start();
        }catch(IllegalThreadStateException e){
        }
    }
    
    class Error_thread extends Thread {
        
        @Override
        public void run() {
            try {
                Error_Frame.setVisible(true);
                try {
                AudioClip no = Applet.newAudioClip(new URL("file:pictures/no.wav"));
                no.play();
                } catch (MalformedURLException ex) {
                }
                Thread.sleep(1000);
                Error_Frame.setVisible(false);
            } catch (InterruptedException e) {
    }}}
}
